package edu.bbu.commonproject.desktop.gui.view.swing.file.traffic.utils;

import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;

import javax.swing.ImageIcon;
import javax.swing.JLabel;

import edu.bbu.commonproject.desktop.gui.view.swing.utils.Design;
import edu.bbu.commonproject.desktop.gui.view.swing.utils.TexturedPanel;

/**
 * the list header.
 */
public class ListHeader extends TexturedPanel
{
	/** The file name label. */
	private JLabel fileNameLabel;
	
	/** The file size label. */
	private JLabel fileSizeLabel;
	
	/** The status imgage label. */
	private JLabel statusImageLabel;
	
	/** The A separator label */
	private Separator sepatatorALabel;
	
	/** The B separator label */
	private Separator sepatatorBLabel;
	
	/** The C separator label */
	private Separator sepatatorCLabel;
	
	/** The file progress label. */
	private ProgressLabel filePercLabel;
	
	/**
	 * The constructor.
	 */
	public ListHeader()
	{
		fileNameLabel = new JLabel("Name");
		fileNameLabel.setHorizontalAlignment(JLabel.CENTER);
		fileNameLabel.setPreferredSize(new Dimension(200, 20));
		
		fileSizeLabel = new JLabel("Size");
		fileSizeLabel.setHorizontalAlignment(JLabel.CENTER);
		fileSizeLabel.setPreferredSize(new Dimension(50, 20));
		
		filePercLabel = new ProgressLabel("Progress");
		
		statusImageLabel = new JLabel();
		statusImageLabel.setIcon(new ImageIcon(Design.TRAFFIC_STATUS));
		
		sepatatorALabel = new Separator();
		sepatatorBLabel = new Separator();
		sepatatorCLabel = new Separator();
		
		this.setLayout(new GridBagLayout());
		this.setTexture(Design.TRAFFIC_COMPONENT_HEADERTEXTURE);
		this.setPreferredSize(new Dimension(500, 30));
		
		GridBagConstraints gridBagConstraints = new GridBagConstraints();
		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
		
		gridBagConstraints.weightx = 0;
		gridBagConstraints.gridx = 0;
		gridBagConstraints.gridy = 0;
		this.add(statusImageLabel, gridBagConstraints);
		
		gridBagConstraints.weightx = 0;
		gridBagConstraints.gridx = 1;
		gridBagConstraints.gridy = 0;
		this.add(sepatatorALabel, gridBagConstraints);
		
		gridBagConstraints.weightx = 0.02;
		gridBagConstraints.gridx = 2;
		gridBagConstraints.gridy = 0;
		this.add(fileNameLabel, gridBagConstraints);
		
		gridBagConstraints.weightx = 0;
		gridBagConstraints.gridx = 3;
		gridBagConstraints.gridy = 0;
		this.add(sepatatorBLabel, gridBagConstraints);
		
		gridBagConstraints.weightx = 0.02;
		gridBagConstraints.gridx = 4;
		gridBagConstraints.gridy = 0;
		this.add(fileSizeLabel, gridBagConstraints);
		
		gridBagConstraints.weightx = 0;
		gridBagConstraints.gridx = 5;
		gridBagConstraints.gridy = 0;
		this.add(sepatatorCLabel, gridBagConstraints);
		
		gridBagConstraints.weightx = 0.50;
		gridBagConstraints.gridx = 6;
		gridBagConstraints.gridy = 0;
		this.add(filePercLabel, gridBagConstraints);		
	}

}
